﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.CodeDom.Compiler;

namespace RobotBattle2.Scripting {
	public class MethodDeclaration : AstNode {
		public SymbolReference Name { get; set; }

		public Collection<SymbolReference> Parameters { get { return m_Parameters; } }
		private Collection<SymbolReference> m_Parameters = new Collection<SymbolReference>();

		public StatementCollection Statements { get { return m_Statements; } }
		private StatementCollection m_Statements = new StatementCollection();

		public override void Dump(IndentedTextWriter writer) {
			Name.Dump(writer);
			writer.Write('(');
			foreach (var item in Parameters) {
				item.Dump(writer);
				writer.Write(',');
			}
			writer.Write(')');
			writer.WriteLine('{');
			Statements.Dump(writer);
			writer.WriteLine('}');
		}
	}
}
